package com.hotleproject.service.impl;

import com.hotleproject.mapper.RoomMapper;
import com.hotleproject.pojo.Room;
import com.hotleproject.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;
    @Override
    public List<Room> findAll() {
        return roomMapper.selectAllRoom();
    }
    @Override
    public int getCount() {
        return roomMapper.getCount();
    }

    @Override
    public List<Room> pageList(int pageNo,int pageSize) {
        return this.roomMapper.pageList(pageNo,pageSize);
    }

    @Override
    public void addRoom(String roomType,String roomPrice,String roomImg,String roomBed,String roomFaci,String roomNum) {
        this.roomMapper.insertRoom(roomType,roomPrice,roomImg,roomBed,roomFaci,roomNum);
    }
}
